package com.simple.business.domain.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.github.zuihou.base.entity.Entity;
import com.simple.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @desc
 * @Author Simple
 * @Date 2024/7/30 14:22
 **/
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("c_user")
@ApiModel(value = "c_user", description = "用户")
@AllArgsConstructor
@Builder
public class User extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @TableField("user_name")
    @Excel(name = "登录名称")
    private String userName;

    @TableField("nick_name")
    @Excel(name = "用户名称")
    private String nickName;

    @TableField("email")
    @Excel(name = "用户邮箱")
    private String email;

    @TableField("mobile")
    @Excel(name = "手机号码", cellType = Excel.ColumnType.TEXT)
    private String mobile;

    @TableField("wx")
    @Excel(name = "微信号", cellType = Excel.ColumnType.TEXT)
    private String wx;

    @TableField("wx_open_id")
    @Excel(name = "微信openId", cellType = Excel.ColumnType.TEXT)
    private String wxOpenId;

    @TableField("sex")
    @Excel(name = "用户性别")
    private String sex;

    @TableField("avatar")
    private String avatar;

    @TableField("password")
    private String password;

    @TableField("status")
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private Boolean status;

    @TableField("login_ip")
    @Excel(name = "最后登录IP", type = Excel.Type.EXPORT)
    private String loginIp;

    @TableField("login_time")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT)
    private LocalDateTime loginTime;

    @TableField("deleted")
    private Boolean deleted;

    @TableField("password_error_num")
    private Integer passwordErrorNum;

    @TableField("password_error_last_time")
    private LocalDateTime passwordErrorLastTime;

    @TableField("password_level")
    private Integer passwordLevel;
}
